<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 17431
  Date: 2019/5/12
  Time: 21:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>案例</title>
</head>
<body>
<%--
        完成数字编号对应星期几案例
            1.域中存储一数字
            2.使用choose标签取出数字         相当于switch声明
            3.使用when标签做数字判断         相当于case
            4.otherwise标签做其他情况的声明  相当于default
    --%>
<%
request.setAttribute("number",5);
%>
<h1>
<c:choose>
    <%--最后不要引号--%>
    <%--标签正常关闭--%>
    <c:when test="${requestScope.number==1}">今天是周一</c:when>
    <c:when test="${requestScope.number==2}">今天是周二</c:when>
    <c:when test="${requestScope.number==3}">今天是周三</c:when>
    <c:when test="${requestScope.number==4}">今天是周四</c:when>
    <c:when test="${requestScope.number==5}">今天是周五</c:when>
    <c:when test="${requestScope.number==6}">今天是周六</c:when>
    <c:when test="${requestScope.number==7}">今天是周日</c:when>
    <c:otherwise>您输入的数据有误</c:otherwise>
</c:choose>

</body>
</html>
